<!--
  文件描述：流程图-选择添加条件
-->
<template>
  <div class="condition">
    <div
        v-for="(item, index) in choose"
        :key="index"
        class="condition-item"
    >
      <div class="condition-icon-box" @click="chooseC(item)">
        <el-icon class="condition-icon" size="30" :color="item.color">
          <component :is="item.icon"></component>
        </el-icon>
      </div>
      <div >{{ item.text }}</div>
    </div>

  </div>
</template>
<script setup name="addConditionPopover">
import {ref, inject} from 'vue'
const { processData } = defineProps(['processData'])

const choose = ref([
  {
    type: '1',
    text: '添加审批人',
    icon: 'UserFilled',
    color: '#409EFF'
  },
  {
    type: '2',
    text: '添加条件',
    icon: 'Menu',
    color: '#67C23A'
  }
])
// 获取到祖组件提供的更改数据方式
const addData = inject('addData')
const chooseC = (item) => {
  addData?.({
    nodeId: processData.nodeId,
    type: item.type
  })
}


</script>
<style scoped lang="less">
@import '@/view/workflow/config/components/index.less';
</style>